<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// This is a test to make sure that a placeholder, even one without our special
// class on it, is removed only when it has been collapsed away or when it has
// been displaced by pasted content.
//
// Placeholders with our special class can, through bugs in deletion, be
// inserted into the document unnecessarily. Once that happens, we don't want to
// make matters worse by removing them if they are acting as line breaks instead
// of placeholders.
//
// Note: Blink doesn't support "webkit-block-placeholder" anymore.
selection_test(
    [
        '<div contenteditable>',
            'abc|<br class="webkit-block-placeholder">',
            'def',
        '</div>',
    ],
    'InsertHTML XYZ',
    [
        '<div contenteditable>',
            'abcXYZ|<br class="webkit-block-placeholder">',
            'def',
        '</div>',
    ],
    'special placeholder');
selection_test(
    [
        '<div contenteditable>',
            'abc|<br>',
            'def',
        '</div>',
    ],
    'InsertHTML XYZ',
    [
        '<div contenteditable>',
            'abcXYZ|<br>',
            'def',
        '</div>',
    ],
    'just <br>');
</script>
